/*
 * Project: push-center-biz-core
 * 
 * File Created at 2014-10-9
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.core.enums;

/**
 * MsgType 0 点对点 1.全部 2.群推送 3.上传的数据 4.筛选出来的数据 5.域推送
 * 
 * @author zhaoli
 * @date 2014-10-9
 * @version V1.0
 */
public enum MsgSendType {
    POINT(0, "点对点 ", false), ALL(1, "全部", true), GROUP(2, "群推送", false), UPLOAD(3, "上传途径", true), CONDITIONS(4, "筛选获取", true), DOMAIN(5,
            "域发送", true);
    private int type;
    private String text;
    private boolean skipQueue;// 是否跳过第一阶段入队列处理而直接入db

    private MsgSendType(int type, String text, boolean skipQueue) {
        this.type = type;
        this.text = text;
        this.skipQueue = skipQueue;
    }

    public static MsgSendType getMsgType(Integer type) {
        for (MsgSendType msgType : MsgSendType.values()) {
            if (msgType.getType() == type) {
                return msgType;
            }
        }
        return null;
    }

    public static boolean isSkipQueue(MsgSendType msgSendType) {
        return msgSendType.skipQueue;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public boolean isSkipQueue() {
        return skipQueue;
    }

    public void setSkipQueue(boolean skipQueue) {
        this.skipQueue = skipQueue;
    }

}
